<template>
  <view>
    <view class="colorB" style="padding:30rpx;" v-for="(item ,index) in invoiceList" :index="index" :key="index">
      <view class="mainColor border-10" style="border: 1px solid #fff;">
        <view class="padding-10">会员ID：{{item.memberId}}</view>
        <view class="padding-10">状态：{{invoice(item.status)}}</view>
        <view class="padding-10">开票总金额：{{item.totalAmount}}</view>
        <view class="padding-10">总服务费金额：{{item.totalServiceAmount}}</view>
        <view class="padding-10">总电费金额：{{item.totalElecAmount}}</view>
        <view class="padding-10">申请时间：{{item.createTime}}</view>
        <view class="padding-10">开票时间：{{item.updateTime || '一'}}</view>
        <view class="flex justify-between align-center padding-10">
          <view class="flex" style="color: #1890FF;">
            操作：
            <u-icon name="file-text" color="#1890FF" size="40" style="margin-left: 20rpx;" />
            <navigator open-type="navigate" :url="'/equipment/invoiceDetail/invoiceDetail?id='+ item.id">
              查看详情
            </navigator>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>
<script>
  import {
    invoiceStatus,
  } from '@/common/dict.js'
  export default {
    props: ['invoiceList'],
    data() {
      return {
        total: 0,
        invoiceStatusList: []
      }
    },
    methods: {
      // 组件传递的事件 1
      invoice(type) {
        invoiceStatus.then(res => {
          this.invoiceStatusList = res
        })
        let str = this.invoiceStatusList.find(item => {
          return item.dictValue == type
        })
        if (str == null) {
          return '一'
        } else {
          return str.dictLabel
        }
      },
    }
  }
</script>
<style lang="scss">
  page {
    background-color: $uni-bg-color !important;
  }
</style>
<style lang="scss" scoped>
  .scroll-Y {
    height: 400rpx;
  }

  .uni-group {
    display: flex;
    align-items: center;
  }

  .goods_nav {

    display: flex;

    height: 7%;

    // margin-top: 100rpx;
    // margin-bottom: 100px;
    align-items: center;
    justify-content: space-between;

    .goods_btn {
      // height: 40px;
      width: 50%;
      text-align: center;
      line-height: 40px;
      background: #2979ff;
      border-radius: 45px;
      color: #fff;
    }

  }

  .startBtn {
    width: 50%;
    margin-right: 20rpx;
    text-align: center;
    line-height: 40px;
    border-radius: 45px;
    color: #fff;
    background-color: #2979ff;
  }
</style>